package com.yanqu.road.server.cmd.union.cross.huaben;

import com.yanqu.road.pb.union.cross.UnionHuaBenProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.union.huaben.CrossUnionHuaBenMgr;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

import java.util.List;

@Cmd(code = Protocol.C_CROSS_UNION_HUA_BEN_GUAN_PU_RECORD_LIST, desc = "关扑奖励公告")
public class CrossUnionHuaBenGuanPuHistoryRecordCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {


        List<UnionHuaBenProto.UnionHuaBenGuanPuHistoryRecordTemp> list = CrossUnionHuaBenMgr.getGuanPuRewardRecord(serverId);
        UnionHuaBenProto.UnionHuaBenGuanPuHistoryRecordRespMsg.Builder respMsg = UnionHuaBenProto.UnionHuaBenGuanPuHistoryRecordRespMsg.newBuilder();
        respMsg.setRet(0);
        respMsg.addAllRecord(list);
        MessageHelper.sendPacket(serverId, packet.getPlayerId(), YanQuMessageUtils.buildMessage(Protocol.U_CROSS_UNION_HUA_BEN_GUAN_PU_RECORD_LIST,
                respMsg));

    }

    @Override
    public void sendData() {

    }
}
